﻿using System.Collections.Generic;
using System.ServiceModel;

namespace RockBus.DataContracts
{
    [MessageContract(WrapperNamespace = StringConstants.RockBusNamespace)]
    public class RemoveSubscriptionsRequest
    {
        public RemoveSubscriptionsRequest()
        {
            this.SubscriptionIds = new List<string>();
        }

        public RemoveSubscriptionsRequest(string subscriberId)
            : this()
        {
            this.SubscriberId = subscriberId;
        }

        public RemoveSubscriptionsRequest(string subscriberId, string subscriptionId)
            : this(subscriberId)
        {
            this.SubscriptionIds.Add(subscriptionId);
        }

        public RemoveSubscriptionsRequest(string subscriberId, IEnumerable<string> subscriptionIds)
            : this(subscriberId)
        {
            ((List<string>)this.SubscriptionIds).AddRange(subscriptionIds);
        }

        [MessageBodyMember]
        public string SubscriberId { get; private set; }

        [MessageBodyMember]
        public ICollection<string> SubscriptionIds { get; private set; }
    }
}